<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">

    <title>props</title>
</head>

<body>
    <h1>props</h1>
    <ol>
    </ol>
    <hr />
    <div id="demoReact"></div>
</body>
<script src="../../node_modules/babel-standalone/babel.min.js"></script>
<script src="../../node_modules/react/umd/react.development.js"></script>
<script src="../../node_modules/react-dom/umd/react-dom.development.js"></script>
<script type="text/babel">

    function Com(props) {
        return (
            <div>我是一个无状态组件，姓名：{props.name}，年龄：{props.age}</div>
        )
    }

    let human = {
        name: "奉先",
        age: 33,
    }



    let com = <div>
        <Com name={human.name} age={human.age}/>
        <Com {...human} />
    </div>;

    // 创建根节点
    let root = ReactDOM.createRoot(document.getElementById("demoReact"));

    // 渲染组件
    root.render(com);

</script>

</html>